package com.hieu.sms.persist;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.hieu.sms.model.Teacher;

@Repository
@Transactional
public class TeacherDaoImpl extends AbstractHibernateDAOImpl<Teacher, Long>
		implements TeacherDao {

	@Override
	protected Class<Teacher> getDomainClass() {	
		return Teacher.class;
	}
	
	@SuppressWarnings("unchecked")
	public List<Teacher> findByDepId(String depId){
		Query query = getSession().getNamedQuery("Teacher.findByDepId").setString("depId", depId);
		return query.list();
	}

}
